package com.demo2do.fms.entity.business.shipment;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 
 * @author Wy
 *
 */
@Entity
@Table(name = "VW_SHIPMENT_LINE")
public class ShipmentLine {
    
    /** 调度指令号  */
    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "assigned")
    private String shipmentNumber;
    
    /** 调度指令组号  */
    private String shipmentGroup;
    
    /** 派出单号*/
    private Long dispatchOrderId;
    
    private Long loadId;
    
    /** 托运客户 */
    private Long customerId;
    
    /** 承运商Id，对应orgId  */
    private Long transCorpId;
    
    /** 结算方ID*/
    private Long balanceId;
    
    /** 驳运车 */
    private Long transMeansId;
    
    /** 制造商 */
    private Long manufactorId;
    
    /** 制造商代码 */
    private String manufactorCode;
    
    /** 制造商名称 */
    private String manufactorName;
    
    /** 装车道号  */
    private String driveWay;
    
    /**商品车类型*/
    private String carSummary;
    
    /** 起始地 */
    private Long srcWhId;
    
    /** 目的地 */
    private Long destWhId;
    
    /** 调度方式  */
    private String transType;
    
    /** 调度数量 */
    private Long loadQuantity;
    
    /** 
     * 状态
     *      - 1 生效
     *      - 2 已派车
     *      - 3 已回单确认(已完成)
     *      - 4 已绑定
     *      - 5 已到达 
     */
    private Long status;
    
    /** 预计装运时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape=JsonFormat.Shape.STRING , pattern ="yyyy-MM-dd")
    private Date loadingTime;
    
    /** 预计起运时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape=JsonFormat.Shape.STRING , pattern ="yyyy-MM-dd")
    private Date leavingTime;
    
    /** 预计到达时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape=JsonFormat.Shape.STRING , pattern ="yyyy-MM-dd")
    private Date arrivingTime;
    
    /** 日期  shipmentDate*/
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape=JsonFormat.Shape.STRING , pattern ="yyyy-MM-dd")
    private Date createTime;
    
    /** 是否启用 */
    @Column(name = "is_disabled")
    private Boolean disabled;
    
    /** 事故标志 */
    @Column(name = "is_accident")
    private Boolean accident;
    
    /**
     * the default constructor
     */
    public ShipmentLine() {
    }
    
    /**
     * @return the transType
     */
    public TransType getTransType() {
    	
    	if (StringUtils.isBlank(transType)) {
    		return null;
    	}
    	
        return TransType.ordinalOf(transType);
        
    }

    /**
     * @return the shipmentNumber
     */
    public String getShipmentNumber() {
        return shipmentNumber;
    }

    /**
     * @return the shipmentGroup
     */
    public String getShipmentGroup() {
        return shipmentGroup;
    }

    /**
     * @return the dispatchOrderId
     */
    public Long getDispatchOrderId() {
        return dispatchOrderId;
    }

    /**
     * @return the loadId
     */
    public Long getLoadId() {
        return loadId;
    }

    /**
     * @return the customerId
     */
    public Long getCustomerId() {
        return customerId;
    }

    /**
     * @return the transCorpId
     */
    public Long getTransCorpId() {
        return transCorpId;
    }

    /**
     * @return the balanceId
     */
    public Long getBalanceId() {
        return balanceId;
    }

    /**
     * @return the transMeansId
     */
    public Long getTransMeansId() {
        return transMeansId;
    }

    /**
     * @return the manufactorId
     */
    public Long getManufactorId() {
        return manufactorId;
    }
    
    /**
     * @return
     */
    public String getManufactorCode() {
        return manufactorCode;
    }
    
    /**
     * @return
     */
    public String getManufactorName() {
        return manufactorName;
    }

    /**
     * @return the driveWay
     */
    public String getDriveWay() {
        return driveWay;
    }

    /**
     * @return the carSummary
     */
    public String getCarSummary() {
        return carSummary;
    }

    /**
     * @return the srcWhId
     */
    public Long getSrcWhId() {
        return srcWhId;
    }

    /**
     * @return the destWhId
     */
    public Long getDestWhId() {
        return destWhId;
    }

    /**
     * @return the loadQuantity
     */
    public Long getLoadQuantity() {
        return loadQuantity;
    }

    /**
     * @return the status
     */
    public Long getStatus() {
        return status;
    }

    /**
     * @return the loadingTime
     */
    public Date getLoadingTime() {
        return loadingTime;
    }

    /**
     * @return the leavingTime
     */
    public Date getLeavingTime() {
        return leavingTime;
    }

    /**
     * @return the arrivingTime
     */
    public Date getArrivingTime() {
        return arrivingTime;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the disabled
     */
    public Boolean getDisabled() {
        return disabled;
    }

    /**
     * @return the accident
     */
    public Boolean getAccident() {
        return accident;
    }

    /**
     * @param shipmentNumber the shipmentNumber to set
     */
    public void setShipmentNumber(String shipmentNumber) {
        this.shipmentNumber = shipmentNumber;
    }

    /**
     * @param shipmentGroup the shipmentGroup to set
     */
    public void setShipmentGroup(String shipmentGroup) {
        this.shipmentGroup = shipmentGroup;
    }

    /**
     * @param dispatchOrderId the dispatchOrderId to set
     */
    public void setDispatchOrderId(Long dispatchOrderId) {
        this.dispatchOrderId = dispatchOrderId;
    }

    /**
     * @param loadId the loadId to set
     */
    public void setLoadId(Long loadId) {
        this.loadId = loadId;
    }

    /**
     * @param customerId the customerId to set
     */
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    /**
     * @param transCorpId the transCorpId to set
     */
    public void setTransCorpId(Long transCorpId) {
        this.transCorpId = transCorpId;
    }

    /**
     * @param balanceId the balanceId to set
     */
    public void setBalanceId(Long balanceId) {
        this.balanceId = balanceId;
    }

    /**
     * @param transMeansId the transMeansId to set
     */
    public void setTransMeansId(Long transMeansId) {
        this.transMeansId = transMeansId;
    }

    /**
     * @param manufactorId the manufactorId to set
     */
    public void setManufactorId(Long manufactorId) {
        this.manufactorId = manufactorId;
    }
    
    /**
     * @param manufactorCode
     */
    public void setManufactorCode(String manufactorCode) {
        this.manufactorCode = manufactorCode;
    }
    
    /**
     * @param manufactorName
     */
    public void setManufactorName(String manufactorName) {
        this.manufactorName = manufactorName;
    }

    /**
     * @param driveWay the driveWay to set
     */
    public void setDriveWay(String driveWay) {
        this.driveWay = driveWay;
    }

    /**
     * @param carSummary the carSummary to set
     */
    public void setCarSummary(String carSummary) {
        this.carSummary = carSummary;
    }

    /**
     * @param srcWhId the srcWhId to set
     */
    public void setSrcWhId(Long srcWhId) {
        this.srcWhId = srcWhId;
    }

    /**
     * @param destWhId the destWhId to set
     */
    public void setDestWhId(Long destWhId) {
        this.destWhId = destWhId;
    }

    /**
     * @param transType
     */
    public void setTransType(String transType) {
		this.transType = transType;
	}

    /**
     * @param loadQuantity the loadQuantity to set
     */
    public void setLoadQuantity(Long loadQuantity) {
        this.loadQuantity = loadQuantity;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(Long status) {
        this.status = status;
    }

    /**
     * @param loadingTime the loadingTime to set
     */
    public void setLoadingTime(Date loadingTime) {
        this.loadingTime = loadingTime;
    }

    /**
     * @param leavingTime the leavingTime to set
     */
    public void setLeavingTime(Date leavingTime) {
        this.leavingTime = leavingTime;
    }

    /**
     * @param arrivingTime the arrivingTime to set
     */
    public void setArrivingTime(Date arrivingTime) {
        this.arrivingTime = arrivingTime;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }

    /**
     * @param accident the accident to set
     */
    public void setAccident(Boolean accident) {
        this.accident = accident;
    }

}
